package co.yixiang.modules.user.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author lsh
 * @date 2021-04-19
 */
@Data
@TableName("area")
public class Area extends BaseDomain {
    /** ID */
    @TableId
    private Long id;

    /** 名称 */
    @NotBlank
    private String name;

    /** 上级区域 */
    private Long parentId;

    /** 状态 */
    private Boolean enabled;




    private Integer level;

    private Integer sequence;


    public void copy(Area source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
